package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {
    /**
     * 根据openId查询用户
     * @param openID
     * @Return User
     */
    @Select("select * from user where openid = #{openID}")
    User getByOpenId(String openID);

    /**
     * 根据id查询用户
     * @param id
     * @return
     */
    @Select("select * from user where id=#{id}")
    User getById(Long id);

    /**
     * 新增一个用户
     * @param user1
     */
    int insert(User user1);
}
